package com.ithm;

public class Demo1 {
    public static void main(String[] args) {
        int[] arr={6,7,4,3,9,5,7,8};
        for (int i = 0; i < arr.length; i++) {

            int d= arr[i]>(arr[i+1])?arr[i]:(arr[i+1]);
            System.out.println(d);
        }
    }
}
